public class AnonymousClassTest {
    public static void main(String[] args) {
        AnonymousClassTest.method(new Project("John") {   //匿名子对象
            @Override
            public String getName() {
                return this.name;
            }
        });
    }

    public static void method(Project p) {
        System.out.println("the name of this project is " + p.getName());
    }
}


//abstract class
abstract class Project {
    public String name;

    Project() {
    }

    Project(String name) {
        this.name = name;
    }

    abstract public String getName();
}